home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Testing & Debugging / Robix V1.0 / JG_prolog.a.lst < prev    next >
Encoding:
File List  |  1991-08-21  |  6.2 KB  |  109 lines  |  [TEXT/MPS ]

  1.  
  2. MC680xx Assembler - Ver 3.2b6                                                                              30-May-91  Page   1
  3. Copyright Apple Computer, Inc. 1984-1991
  4.  
  5. Loc   F Object Code     Addr  M    Source Statement
  6.  
  7.                                    ;
  8.                                    ;
  9.                                    ; Copyright © 1991, Apple Computer, Inc.
  10.                                    ;
  11.                                    ; by Rob Glanville
  12.                                    ;
  13.                                    ; 15 May 91
  14.                                    ;
  15.                                    ; JG_prolog.a - Startup assembly code
  16.                                    ;
  17.                                    ;
  18.                                    ; Memory Map - 512kb assumed
  19.                                    ; 00000000 - 000003FF = Interrupt Vectors
  20.                                    ; 00000400 - 000005FF = Command buffer
  21.                                    ; 00000600 - 00007FFF = Stack
  22.                                    ; 00008000 - 0000FFFF = Data
  23.                                    ; 00010000 - 00017FFF = Code
  24.                                    ; 00018000 - 0007FFFF = Free memory
  25.                                    ; 00080000 - 00FFFFFF = Memory mapped I/O
  26.                                    ;
  27.                                    ; Since this code is linked in with the application that uses it, the
  28.                                    ; A5 data reference changes every time variables are added or subtracted.
  29.                                    ; To pin down the data for this code, A5 is adjusted so the top of the
  30.                                    ; data is always at 10000. It's tricky so don't fool with it!
  31.                                    ; The main purpose of this code is to provide a stable environment for
  32.                                    ; the C code to start with. All the real work should be done in C.
  33.                                    ; Try not to modify this code if possible, it is just a bridge.
  34.                                    ;
  35.                                    ; How this works;
  36.                                    ; 1) The stack and data reference registers are initialized
  37.                                    ; 2) The data segment is cleared
  38.                                    ; 3) A key word is used to signal the Mac we're ready to go
  39.                                    ; 4) We wait for a test command before jumping to the C code
  40.  
  41.         0001 8000                  TOS        equ    $18000        ; Top of stack
  42.         0000 FFFE                  TOD        equ    $fffe        ; Top of Data
  43.         0000 03FE                  ClearCount    equ    $3FE        ; Clear this many 32 bit words
  44.         0000 00FE                  VectorCount    equ    $fe        ; Number of vector pointers
  45.         0000 0000                  Null        equ    $00000000    ; Zero
  46.         0000 2700                  InitialSR    equ    $2700        ; Initial status register
  47.         0000 0008                  ClearStart    equ    $00000008    ; After the reset vector
  48.         0000 0000                  Pattern        equ    $00000000    ; Clear memory pattern
  49.         0050 0000                  GreenLight    equ    $00500000    ; Green light control
  50.         0040 0000                  RedLight    equ    $00400000    ; Green light control
  51.         0060 0000                  SmartMode    equ    $00600000    ; Smart mode control
  52.  
  53.                                        import    COMMANDLOOP
  54.  
  55. 00000                              Begin    proc    export
  56. 00000                                  data
  57. 00000                                  import    TopOfData        ; First variable in C code
  58. 00000                                  code
  59. 00000 P 46FC 2700                      move.w    #InitialSR,sr        ; Clear interrupts
  60. 00004 G 2E7C 0001 8000                 move.l    #TOS,sp            ; Set up the stack pointer
  61. 0000A   1039 00CA 000C                 move.b    $CA000C,d0        ; Reset and clear
  62. 00010   1039 00CA 0008                 move.b    $CA0008,d0        ; Reset and clear
  63. 00016   1039 00C0 0004                 move.b    $C00004,d0        ; Reset and clear
  64. 0001C   1039 00C0 0002                 move.b    $C00002,d0        ; Reset and clear
  65. 00022 G 4239 00CA 000D                 move.b    #$00,$CA000D        ; Reset and clear
  66. 00028   13FC 0087 00CA                 move.b    #$87,$CA000F        ; Reset and clear
  67.              000F 
  68. 00030 G 4279 00CA 0008                 move.w    #$0000,$CA0008        ; Reset DMA control register
  69. 00036   3039 0060 0000                 move.w    SmartMode,d0        ; Select smart mode
  70. 0003C   3039 0040 0000                 move.w    RedLight,d0        ; Turn on red light
  71. 00042   33C0 0050 0000                 move.w    d0,GreenLight        ; Turn off green light
  72. 00048   203C 0000 FFFE                 move.l    #TOD,d0            ; Set up data pointer
  73. 0004E G 9BCD                           move.l    #Null,a5        ; Set up data pointer
  74. 00050   41ED 0000                      lea    TopOfData,a0        ; Get address
  75. 00054   2208                           move.l    a0,d1            ; Copy
  76. 00056   9081                           sub.l    d1,d0            ; Adjust
  77. 00058 G 2A40                           move.l    d0,a5            ; Set the data offset
  78. 0005A   203C 0000 03FE                 move.l    #ClearCount,d0        ; Set data size
  79. 00060 G 307C 0008                      move.l    #ClearStart,a0        ; Clear pointer
  80. 00064 G 4298                       clear    move.l    #Pattern,(a0)+        ; Zap memory
  81.  
  82. MC680xx Assembler - Ver 3.2b6                                                                              30-May-91  Page   2
  83. Copyright Apple Computer, Inc. 1984-1991
  84.  
  85. Loc   F Object Code     Addr  M    Source Statement
  86.  
  87. 00066 G 51C8 FFFC       00064          dbra    d0,clear        ; Loop back until done
  88. 0006A   43FA 0026       00092          lea    UnusedInterrupt,a1    ; Get the pointer
  89. 0006E   203C 0000 00FE                 move.l    #VectorCount,d0        ; Set vector count
  90. 00074 G 307C 0008                      move.l    #ClearStart,a0        ; Clear pointer
  91. 00078   20C9                       Zap    move.l    a1,(a0)+        ; Zap memory
  92. 0007A G 51C8 FFFC       00078          dbra    d0,Zap            ; Loop back until done
  93. 0007E   3039 0050 0000                 move.w    GreenLight,d0        ; Turn on green light
  94. 00084   33C0 0040 0000                 move.w    d0,RedLight        ; Turn off red light
  95. 0008A   6000 FF74                      bra.w    COMMANDLOOP        ; Enter the C code
  96. 0008E   6000 FF70       00000          bra.w    Begin            ; Start over if we ever return
  97. 00092
  98. 00092                              UnusedInterrupt
  99. 00092   21FC 496E 7430                 move.l    #'Int0',$0        ; Set the error flag
  100.              0000 
  101. 0009A P 4E73                           rte                ; Interrupt return
  102. 0009C
  103. 0009C                                  endp                ; End of procedure
  104.                                        end                ; End of source
  105.  
  106. Elapsed time: 0.15 seconds.
  107.  
  108. Assembly complete - no errors found.  90 lines.
  109.